package com.atguigu.service.impl;

import com.atguigu.dao.UserDao;

import com.atguigu.dao.impl.BaseDao;
import com.atguigu.dao.impl.UserDaoImpl;
import com.atguigu.pojo.User;
import com.atguigu.service.UserService;

public class UserServiceImpl  implements UserService   {
 private UserDao userDao = new UserDaoImpl();
    @Override
    public void registUser(User user) {
        userDao.saveuser(user);
    }

    @Override
    public User login(User user) {
      return   userDao.queryUserByusernameAndPassword(user.getUsername(), user.getPASSWORD());
    }

    @Override
    public boolean existUsername(String username) {
if (userDao.queryUserByusername(username) ==null){
    return false;
}
return true;
    }
}
